// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'babel-polyfill'
import Vue from 'vue'
import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'
import App from './App'
import axios from './http/http'
// import moment from 'moment'
import { Format } from './common/js/time.js'
import fastclick from 'fastclick'
import router from './router'
import preview from 'vue-photo-preview'
import 'vue-photo-preview/dist/skin.css'
import vuePicturePreview from 'vue-picture-preview'

fastclick.attach(document.body)

Vue.use(Mint)
Vue.use(preview)
Vue.use(vuePicturePreview)
import './common/sass/index.scss'

Vue.config.productionTip = false
Vue.prototype.$http = axios

// 允许vue使用自定义标签
Vue.config.ignoredElements = [
  'wx-open-launch-weapp'
]
// Vue.filter('dateFmt', (input, dateFmtString) => {
//   const lastFmtString = dateFmtString || 'YYYY-MM-DD HH:mm:ss'
//   return moment(input).format(lastFmtString)
// })
// import {getCookie, setCookie, delCookie} from './common/js/cookies.js'
// Vue.prototype.$cookieStore = {
//   getCookie,
//   setCookie,
//   delCookie
// }

Vue.filter('dateFmt', (time, fmt) => {
  return Format(time, fmt)
})
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  // store,
  template: '<App/>',
  components: {App}
})
